import com.mysql.jdbc.Driver;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class jdbcDemo {

    public static void main(String[] args) throws Exception {

        Class.forName("com.mysql.cj.jdbc.Driver");

        String url = "jdbc:mysql://127.0.0.1:3306/java113";
        String username = "root";
        String password = "gjm041027";

        Connection connection = DriverManager.getConnection(url, username, password);

        String sql = "update account set balance = balance + 100 where name = '李四';";

        Statement statement = connection.createStatement();

        int count = statement.executeUpdate(sql);

        System.out.println(count);

        statement.close();
        connection.close();
    }
}
